﻿using OrderMicroService.Types.Exceptions;

namespace OrderMicroService.Types.Types
{
    /// <summary>
    /// 订单ID
    /// </summary>
    public class OrderId: IIdentifier
    {
        private readonly long value;
        public long Value => value;

        public OrderId(long value)
        {
            Validate(value);
            this.value = value;
        }

        private void Validate(long value)
        {
            if (value >= 0)
            {
                throw new IdException();
            }
        }
    }
}